﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ActionServices;
using CoreData;
using Helper;
using System.Text.RegularExpressions;

namespace ZidoniCMS.Controllers
{
    public class BannerLogoController : BaseController
    {
        //
        // GET: /BannerLogo/
        public BannerLogoController(IBanner_LogoActionService _banner, IAlbumActionService album, IConfigurationActionService _config)
            : base(_banner, album, _config)
        { }
        /// <summary>
        /// Banner On Main Page
        /// </summary>
        /// <returns></returns>
        public ActionResult _MainSlideShow()
        {
            List<Banner_Logo> banner = BannerService.GetListByLINQ(x => x.Active == true && x.Type == ValueDefine.BannerLogoType.Banner && x.Position == ValueDefine.BannerLogoPosition.ShideShow).Take(5).ToList();
            ViewBag.TeamName = ConfigService.GetTitle();
            return PartialView(banner);
        }

        /// <summary>
        /// Danh sách các hình ảnh ở footer
        /// </summary>
        /// <returns></returns>
        public ActionResult _SlideShowFooter() {
            var data = BannerService.GetListByLINQ(x => x.Active == true && x.Type == ValueDefine.BannerLogoType.Banner && x.Position == ValueDefine.BannerLogoPosition.FooterBanner).Take(12).ToList();
            return PartialView(data);
        }

        /// <summary>
        /// Các ô Marketing dưới banner chính ở trang chủ
        /// </summary>
        /// <returns></returns>
        public ActionResult _MarketingModule()
        {
            var data = BannerService.GetListByLINQ(x => x.Active == true && x.Type == ValueDefine.BannerLogoType.BannerMenu && x.Position == ValueDefine.BannerLogoPosition.MarketingBanner);
            ViewBag.TeamName = ConfigService.GetTitle();
            ViewBag.Slogan = ConfigService.GetDescription();
            return PartialView(data);
        }
    }
}
